#override("title")
CiaoTalking - 商品管理
#end
#override("css")
<link href="#springUrl('/static/css/plugins/bootstrap-table/bootstrap-table.min.css')" rel="stylesheet">
#end
#override("breadcrumb")
<li><a>商品管理</a></li><li class="active"><strong>维护厂家信息</strong></li>
#end
#override("content")
<div class="row">
	<div class="ibox-content text-right form-inline" style="background: #F3F3F4;">
		<button class="btn btn-primary" onclick="editManufactor(null)" type="button">
		<i class="fa fa-pencil"></i>&nbsp;添加厂家信息</button>
	</div>
</div>
<div class="row">
    <div class="col-sm-12">
        <table id="dataTable"></table>
    </div>
</div>
#end
#override("js")
<script src="#springUrl('/static/js/plugins/bootstrap-table/bootstrap-table.min.js')"></script>
<script src="#springUrl('/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js')"></script>
<script src="#springUrl('/static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js')"></script>
<script src="#springUrl('/static/plugins/layer-v2.2/layer/layer.js')"></script>
<script src="#springUrl('/static/js/base_list.js')"></script>
<script src="#springUrl('/static/js/common.js')"></script>
<script type="text/javascript">
    var dataUrl = "#springUrl('/item/manufactor/getManufactorList')";
    var dataColumns = [{
        field: 'id',
        title: '序号'
    }, {
        field: 'manufactor',
        title: '生产厂家'
    },{
        title: '操作',
        formatter: function (value, row, index) {
            var id = row.id;
            return '<a class="btn btn-xs btn-warning" onclick="editManufactor('+id+')"><i class="fa fa-pencil"></i>编辑</a>'
        }
    }
    ];

function editManufactor(manufactorId){
   	var title = "新增生产厂家";
   	var url = "#springUrl('/item/manufactor/edit')";
    if(manufactorId!=null){
   		title = "编辑生产厂家";
   		url += "?manufactorId=" + manufactorId;
   	}
    layer.open({
        type: 2,
        title: title,
        shadeClose: false,
        shade: 0.8,
        area: ['400px', '300px'],
        fix: false,
        maxmin: true,
        content: url
    });
}
</script>
#end
#extends("/common/framework.html")
